{% capture imagePath %}{{ page.date | date: "%Y/%m/%d" }}/{{ page.title | slugify }}/{{ include.src }}{% endcapture %}
{% if include.caption %}
<figure>
  <img src="/img/{{ imagePath }}" {% if include.alt %} alt="{{ include.alt }}" {% endif %} {% if include.width %} width="{{ include.width }}" {% endif %}/>
  <figcaption>{{ include.caption }}</figcaption>
</figure>
{% else %}
<img src="/img/{{ imagePath }}" {% if include.alt %} alt="{{ include.alt }}" {% endif %} {% if include.width %} width="{{ include.width }}" {% endif %}/>
{% endif %}
